<%--
    Document   : account
    Created on : 5/Jun/2009, 0:42:26
    Author     : eurico
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="deti.es.ukni.cm.account.AccountBean"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

 <%
    AccountBean curAccount = (AccountBean) session.getAttribute("account");
    if ( curAccount != null )
        response.sendRedirect("./");
    else{

    String message = (String) session.getAttribute("message");
    if ( message != null ){
        session.removeAttribute("message");
    }

%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>MyBand</title>
        <link rel="stylesheet" type="text/css" href="../resource/myband.css" />
        <link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" />
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
        <script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script>
        <script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.datepicker.js"></script>
      <!--  <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script>
-->

        <script>
             $(document).ready( function(){

                //$("#newband").hide();
                $("#atype").click( function(){
                    $("#newband").slideToggle("fast");
                    $("#bname").toggleClass("required");

                });

                $(".toggletext ~ textarea").hide();
                $(".toggletext").click(function(){
                    $(this).next("textarea").slideToggle();
                });

                // form validation
                //$("#newaccount").validate();
                // Date picker
                $(".datepicker").datepicker({
                    onSelect: function(dateText, inst){
                        $("#bfdate").attr("value", dateText);
                    }
                });
                $("#bfdate").attr("value", $(".datepicker").datepicker('getDate') );

             });
        </script>
    </head>
    <body>

        <div id="header">
            <div id="logo">
                <img src="../resource/mybandlogo.png" alt="myband_logo"/>
            </div>
        </div>

        <div id="nav">
            <ul>
                <li><a href="login.jsp">Login</a></li>
                <li><a href="../band">Search Bands</a></li>
            </ul>
        </div>

        <div id="content">
        <div class="new_account">
            <h1>Create new account</h1>
            
            <form id="newaccount" method="post" action="createaccount">
            <fieldset>
                <label for="user" > username </label>
                <input id="user" type="text" size="30" name="username" class="required"><p>
                <label for="email">email</label>
                <input id="password" type="text" size="30" name="email" class="required email"><p>
                <label for="pwd">password</label>
                <input id="pwd" type="password" size="30" name="pwd" class="required"><p>
                <input class="submit" type="submit" value="Submit"/>
            </fieldset>

                <label for="atype">I want to create a Band</label>
                <input id="atype" name="atype" type="checkbox" checked><p>

            <fieldset id="newband"><p>
                <div class="bandlabel">My Band</div>

                <label for="bname">Name</label>
                <input id="bname" name="bname" size="30" type="text" class="required"><p>
                <label>Formation date</label><p>
                <div type="text" class="datepicker"></div><p>
                <label for="bdesc" class="toggletext">Description</label>
                <textarea id="bdesc" name="bdesc" cols="30" rows="10">Band description</textarea><p>
                <label for="bbio" class="toggletext">Biography</label>
                <textarea id="bbio" name="bbio" cols="30" rows="10">Band Bio</textarea><p>
                <input id="bfdate" type="hidden" type="text" name="bfdate">
                <input class="submit" type="submit" value="Submit"/>
            </fieldset>
                
            </form>
            
        </div>
        </div>

    </body>
</html>

<% } %>
